import 'package:json_annotation/json_annotation.dart';

import 'common_mode.dart';

part 'message_record_model.g.dart';


@JsonSerializable()
class MessageRecordModel extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'name')
  String? name;

  @JsonKey(name: 'avatar')
  String? avatar;

  @JsonKey(name: 'top')
  int top;

  @JsonKey(name: 'unRead')
  int unRead;

  @JsonKey(name: 'vip')
  int vip;

  @JsonKey(name: 'vipTime')
  String vipTime;

  @JsonKey(name: 'ynSubscribe')
  int ynSubscribe;

  @JsonKey(name: 'badge')
  List<Badge> badge;

  @JsonKey(name: 'pipeList')
  List<PipeInfo> pipeList;

  MessageRecordModel(this.id,this.name,this.avatar,this.top,this.unRead,this.vip,this.vipTime,this.ynSubscribe,this.badge,this.pipeList,);

  factory MessageRecordModel.fromJson(Map<String, dynamic> srcJson) => _$MessageRecordModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$MessageRecordModelToJson(this);

}


@JsonSerializable()
class Badge extends Object {

  @JsonKey(name: 'level')
  int level;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'icon')
  String icon;

  @JsonKey(name: 'style')
  String style;

  @JsonKey(name: 'type')
  int type;

  @JsonKey(name: 'flag')
  int flag;

  @JsonKey(name: 'vip')
  int vip;

  Badge(this.level,this.name,this.icon,this.style,this.type,this.flag,this.vip,);

  factory Badge.fromJson(Map<String, dynamic> srcJson) => _$BadgeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$BadgeToJson(this);

}


@JsonSerializable()
class PipeInfo extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'content')
  List<PipeAlbumMessageModel> content;

  @JsonKey(name: 'top')
  int top;

  @JsonKey(name: 'unRead')
  int unRead;

  @JsonKey(name: 'updatedTime')
  String updatedTime;

  @JsonKey(name: 'ynSubscribe')
  int ynSubscribe;

  PipeInfo(this.id,this.name,this.content,this.top,this.unRead,this.updatedTime,this.ynSubscribe,);

  factory PipeInfo.fromJson(Map<String, dynamic> srcJson) => _$PipeInfoFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PipeInfoToJson(this);

}